<template>
	<view class="container" :style="{ paddingTop: `${statusBarHeight}px` }">
		<SwiperCom></SwiperCom>
		<NavCom></NavCom>
		<ConnectionCom></ConnectionCom>
	</view>
</template>

<script>
import { getNavigationBarHeight } from '@/assets/utils/systemInfo'
import NavCom from './components/nav/index.vue'
import SwiperCom from './components/swiper/index.vue' 
import ConnectionCom from './components/connection/index.vue'
import {get,post} from '@/api/index'
export default {
	components: { NavCom ,SwiperCom,ConnectionCom},
	data() {
		return {
			title: 'Hello',
			statusBarHeight: 40
		}
	},
	onLoad() {
		this.statusBarHeight = getNavigationBarHeight()
		get('/user/getUsers').then(res=>{
			console.log(res)
		})
		this.login()
	},
	methods: {
		login(){
			uni.login({
				success: (res) => {
					console.log('微信登录：',res)
					const {code} = res
					post('/user/login',{code}).then(res=>{
						console.log('登录：',res)
					})
				},
			})
		}
	}
}
</script>

<style scoped lang="less">
.container {
	width: auto;
}
</style>
